<?php

error_reporting(E_ALL);
define('ROOT_PATH', dirname(__DIR__));
try {


    /**
     * Read the configuration
     */
    $globalConfig = include ROOT_PATH . "/brood/config/config.php";
    /**
     * Read the configuration
     */
    $localConfig = include ROOT_PATH . "/app/config/config.php";
    
     

    $config = new Phalcon\Config(array_merge($globalConfig, $localConfig));

    /**
     * Read auto-loader
     */
    $loader = include ROOT_PATH . "/brood/config/loader.php";

    /**
     * Read services
     */
    $di =  include ROOT_PATH . "/brood/config/services.php";

    /**
     * Handle the request
     */
    $application = new \Phalcon\Mvc\Application($di);

    echo $application->handle()->getContent();
} catch (\Exception $e) {
    echo $e->getMessage();
}
